package models.enums;

/**
 * Created by youliangcheng on 17/12/5.
 * 客户等级
 * 优质 , 普通 , 休眠
 */
public enum  UserLevel {

    SENIOR // 优质客户
    ,ORDINARY // 普通客户
    ,DORMANCY ;// 休眠用户

    public static String getUserLevelStr(UserLevel userLevel){
        String userLevelStr = "" ;
        if(userLevel == null)
            return userLevelStr ;

        switch (userLevel){
            case SENIOR : userLevelStr = "优质客户"; break;
            case ORDINARY : userLevelStr = "普通客户"; break;
            case DORMANCY : userLevelStr = "休眠客户"; break;
            default: userLevelStr = "" ;break;
        }

        return userLevelStr ;
    }

    public static UserLevel getUserLevel(String userLevelStr){
        UserLevel userLevel = null ;

        if(userLevelStr.equals(UserLevel.SENIOR.toString()))
            userLevel = UserLevel.SENIOR;

        if(userLevelStr.equals(UserLevel.ORDINARY.toString()))
            userLevel = UserLevel.ORDINARY;

        if(userLevelStr.equals(UserLevel.DORMANCY.toString()))
            userLevel = UserLevel.DORMANCY;

        return userLevel;
    }
}
